package com.lineage.data.item_etcitem.allcall;

import com.lineage.data.executor.ItemExecutor;
import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.model.L1Character;
import com.lineage.server.model.map.L1Map;
import com.lineage.server.serverpackets.S_Message_YN;
import com.lineage.server.serverpackets.S_ServerMessage;
import com.lineage.server.serverpackets.ServerBasePacket;
import java.time.LocalDateTime;

public abstract class AllCall extends ItemExecutor {
  protected static void teleport_AllCall(L1Character cha, L1Character target, int distance) {
    int locX = target.getX();
    int locY = target.getY();
    int heading = target.getHeading();
    L1Map map = target.getMap();
    short mapId = target.getMapId();
    LocalDateTime localNow = LocalDateTime.now();
    if (cha instanceof L1PcInstance) {
      L1PcInstance w = (L1PcInstance)cha;
      w.setTeleportX(locX);
      w.setTeleportY(locY);
      w.setTeleportMapId(mapId);
      if (w.getAllCall_clan() == 1)
        w.sendPackets((ServerBasePacket)new S_Message_YN(748)); 
    } 
  }
  
  protected Boolean checkPcHasSkillEffect(L1PcInstance pc) {
    if (pc.hasSkillEffect(87)) {
      pc.sendPackets((ServerBasePacket)new S_ServerMessage("身上有冲击之晕状态，无法使用穿云箭"));
      return Boolean.TRUE;
    } 
    if (pc.hasSkillEffect(66)) {
      pc.sendPackets((ServerBasePacket)new S_ServerMessage("身上有沉睡之雾状态，无法使用穿云箭"));
      return Boolean.TRUE;
    } 
    if (pc.hasSkillEffect(50)) {
      pc.sendPackets((ServerBasePacket)new S_ServerMessage("身上有冰茅围篱状态，无法使用穿云箭"));
      return Boolean.TRUE;
    } 
    if (pc.hasSkillEffect(33)) {
      pc.sendPackets((ServerBasePacket)new S_ServerMessage("身上有木乃伊的诅咒状态，无法使用穿云箭"));
      return Boolean.TRUE;
    } 
    if (pc.hasSkillEffect(157)) {
      pc.sendPackets((ServerBasePacket)new S_ServerMessage("身上有木乃伊的诅咒状态，无法使用穿云箭"));
      return Boolean.TRUE;
    } 
    return Boolean.FALSE;
  }
}
